package com.asp.alumnisystem.net;

import com.asp.alumnisystem.base.BaseBean;
import com.asp.alumnisystem.model.DetailsModel;
import com.asp.alumnisystem.model.ForumModel;
import com.asp.alumnisystem.model.NoticeModel;
import com.asp.alumnisystem.model.UserModel;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * retrofit 网络接口
 */
public interface ApiService {

    @GET("user/login")
    Observable<BaseBean<UserModel>> login(@Query("loginUser") String loginUser, @Query("loginPass") String loginPass);

    @GET("forum/publish")
    Observable<BaseBean<Boolean>> publish(@Query("userId") Long userId, @Query("content") String content);

    @GET("forum/forumList")
    Observable<BaseBean<List<ForumModel>>> getForumList(@Query("userId") Long userId, @Query("authorId") Long authorId, @Query("pageIndex") int pageIndex, @Query("pageSize") int pageSize);

    @GET("detail/reply")
    Observable<BaseBean<DetailsModel>> reply(@Query("userId") Long userId, @Query("forumId") Long forumId, @Query("content") String content);

    @GET("detail/detailList")
    Observable<BaseBean<List<DetailsModel>>> getDetailList(@Query("userId") Long userId, @Query("forumId") Long forumId, @Query("pageIndex") int pageIndex, @Query("pageSize") int pageSize);

    @GET("notice/noticeList")
    Observable<BaseBean<List<NoticeModel>>> getNoticeList(@Query("userId") Long userId, @Query("pageIndex") int pageIndex, @Query("pageSize") int pageSize);

    @GET("friend/friendList")
    Observable<BaseBean<List<UserModel>>> getFriendList(@Query("userId") Long userId,  @Query("pageIndex") int pageIndex, @Query("pageSize") int pageSize);

    @GET("friend/isMyFriend")
    Observable<BaseBean<Boolean>> isMyFriend(@Query("userId") Long userId,  @Query("otherId") Long otherId);

    @GET("friend/addFriend")
    Observable<BaseBean<Boolean>> addFriend(@Query("userId") Long userId,  @Query("otherId") Long otherId);

    @GET("friend/delFriend")
    Observable<BaseBean<Boolean>> delFriend(@Query("userId") Long userId,  @Query("otherId") Long otherId);

}
